.class public Llecho/lib/hellocharts/model/LineChartData;
.super Llecho/lib/hellocharts/model/AbstractChartData;


# static fields
.field public static final DEFAULT_BASE_VALUE:F


# instance fields
.field private baseValue:F

.field private lines:Ljava/util/List;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Llecho/lib/hellocharts/model/AbstractChartData;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    const/4 v0, 0x0

    iput v0, p0, Llecho/lib/hellocharts/model/LineChartData;->baseValue:F

    return-void
.end method

.method public constructor <init>(Ljava/util/List;)V
    .locals 1

    invoke-direct {p0}, Llecho/lib/hellocharts/model/AbstractChartData;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    const/4 v0, 0x0

    iput v0, p0, Llecho/lib/hellocharts/model/LineChartData;->baseValue:F

    invoke-virtual {p0, p1}, Llecho/lib/hellocharts/model/LineChartData;->setLines(Ljava/util/List;)Llecho/lib/hellocharts/model/LineChartData;

    return-void
.end method

.method public constructor <init>(Llecho/lib/hellocharts/model/LineChartData;)V
    .locals 4

    invoke-direct {p0, p1}, Llecho/lib/hellocharts/model/AbstractChartData;-><init>(Llecho/lib/hellocharts/model/AbstractChartData;)V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    const/4 v0, 0x0

    iput v0, p0, Llecho/lib/hellocharts/model/LineChartData;->baseValue:F

    iget v0, p1, Llecho/lib/hellocharts/model/LineChartData;->baseValue:F

    iput v0, p0, Llecho/lib/hellocharts/model/LineChartData;->baseValue:F

    iget-object v0, p1, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Llecho/lib/hellocharts/model/Line;

    iget-object v2, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    new-instance v3, Llecho/lib/hellocharts/model/Line;

    invoke-direct {v3, v0}, Llecho/lib/hellocharts/model/Line;-><init>(Llecho/lib/hellocharts/model/Line;)V

    invoke-interface {v2, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :cond_0
    return-void
.end method

.method public static generateDummyData()Llecho/lib/hellocharts/model/LineChartData;
    .locals 7

    const/high16 v6, 0x40800000    # 4.0f

    const/high16 v5, 0x40400000    # 3.0f

    const/high16 v4, 0x40000000    # 2.0f

    new-instance v0, Llecho/lib/hellocharts/model/LineChartData;

    invoke-direct {v0}, Llecho/lib/hellocharts/model/LineChartData;-><init>()V

    new-instance v1, Ljava/util/ArrayList;

    const/4 v2, 0x4

    invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(I)V

    new-instance v2, Llecho/lib/hellocharts/model/PointValue;

    const/4 v3, 0x0

    invoke-direct {v2, v3, v4}, Llecho/lib/hellocharts/model/PointValue;-><init>(FF)V

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    new-instance v2, Llecho/lib/hellocharts/model/PointValue;

    const/high16 v3, 0x3f800000    # 1.0f

    invoke-direct {v2, v3, v6}, Llecho/lib/hellocharts/model/PointValue;-><init>(FF)V

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    new-instance v2, Llecho/lib/hellocharts/model/PointValue;

    invoke-direct {v2, v4, v5}, Llecho/lib/hellocharts/model/PointValue;-><init>(FF)V

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    new-instance v2, Llecho/lib/hellocharts/model/PointValue;

    invoke-direct {v2, v5, v6}, Llecho/lib/hellocharts/model/PointValue;-><init>(FF)V

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    new-instance v2, Llecho/lib/hellocharts/model/Line;

    invoke-direct {v2, v1}, Llecho/lib/hellocharts/model/Line;-><init>(Ljava/util/List;)V

    new-instance v1, Ljava/util/ArrayList;

    const/4 v3, 0x1

    invoke-direct {v1, v3}, Ljava/util/ArrayList;-><init>(I)V

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    invoke-virtual {v0, v1}, Llecho/lib/hellocharts/model/LineChartData;->setLines(Ljava/util/List;)Llecho/lib/hellocharts/model/LineChartData;

    return-object v0
.end method


# virtual methods
.method public finish()V
    .locals 2

    iget-object v0, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Llecho/lib/hellocharts/model/Line;

    invoke-virtual {v0}, Llecho/lib/hellocharts/model/Line;->finish()V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public getBaseValue()F
    .locals 1

    iget v0, p0, Llecho/lib/hellocharts/model/LineChartData;->baseValue:F

    return v0
.end method

.method public getLines()Ljava/util/List;
    .locals 1

    iget-object v0, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    return-object v0
.end method

.method public setBaseValue(F)Llecho/lib/hellocharts/model/LineChartData;
    .locals 0

    iput p1, p0, Llecho/lib/hellocharts/model/LineChartData;->baseValue:F

    return-object p0
.end method

.method public setLines(Ljava/util/List;)Llecho/lib/hellocharts/model/LineChartData;
    .locals 1

    if-nez p1, :cond_0

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    :goto_0
    return-object p0

    :cond_0
    iput-object p1, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    goto :goto_0
.end method

.method public update(F)V
    .locals 2

    iget-object v0, p0, Llecho/lib/hellocharts/model/LineChartData;->lines:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Llecho/lib/hellocharts/model/Line;

    invoke-virtual {v0, p1}, Llecho/lib/hellocharts/model/Line;->update(F)V

    goto :goto_0

    :cond_0
    return-void
.end method
